<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue 测试实例 - 菜鸟教程(runoob.com)</title>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
</head>
<body>
<div id="app">
	<input v-model="message">
	<button @click='length=message.length'>计算显示长度</button>
    <p>长度为{{length}}</p>
</div>
    
<script>
new Vue({
  el: '#app',
  data: {
	message: '',
	length:0
  },
  methods: {
	  getLength: function(){
		  this.length=this.message.length
	  }
  }
})
</script>
</body>
</html>
